<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Device Info</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
        }
        select {
            padding: 5px;
            margin-top: 10px;
        }
    </style>
</head>
<body>
    <h1>设备信息</h1>
    {% if device_info == "暂未识别到设备" %}
        <p>{{ device_info }}</p>
    {% else %}
        {% if device_info.type == 'Android' or device_info.type == 'iOS' %}
            <p>设备类型: {{ device_info.type }}</p>
            {% if device_info.type == 'Android' %}
                <p>制造商: {{ device_info.manufacturer }}</p>
            {% endif %}
            <p>型号: {{ device_info.model }}</p>
            <label for="packages">安装的应用程序包:</label>
            <select id="packages" name="packages">
                {% if device_info.packages %}
                    {% with special_package='com.jinbaoxin.jytaobao' %}
                        {% if special_package in device_info.packages %}
                            <option value="{{ special_package }}">{{ special_package }}</option>
                        {% endif %}
                        {% for package in device_info.packages %}
                            {% if package != special_package %}
                                <option value="{{ package }}">{{ package }}</option>
                            {% endif %}
                        {% endfor %}
                    {% endwith %}
                {% else %}
                    <option value="">无</option>
                {% endif %}
            </select>
        {% elif device_info.type == 'HarmonyOS' %}
            <p>设备类型: HarmonyOS</p>
            <p>名称: {{ device_info.name }}</p>
            <p>品牌: {{ device_info.brand }}</p>
            <p>型号: {{ device_info.model }}</p>
            <p>软件版本: {{ device_info.software_version }}</p>
        {% endif %}
    {% endif %}
</body>
</html>